package test.nodes;

import bgai.ai.minimax.ChanceEvent;

public class Chance implements ChanceEvent {

	private int index;
	private double prob;
	
	public Chance(int index, int numSiblings) {
		this.index= index;
		this.prob= 1.0 / (double)numSiblings;
	}
	
	@Override
	public double probability() {
		return prob;
	}

	public int index() {
		return index;
	}
	
	@Override
	public String toString() {
		return "Chance("+index+","+prob+")";
	}
}
